package com.binge.backend.controller;

import com.binge.backend.entity.CartEntity;
import com.binge.backend.service.ICartService;
import com.binge.backend.util.ResultVo;
import com.binge.backend.util.TokenUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author Binge
 * @desc 购物车页面控制器类
 * @date 2020/10/17 下午7:02
 */
@RestController
@RequestMapping("/cart")
@Slf4j
@Api(value = "购物车 API 接口",tags = "购物车 API 接口")
public class CartController {
    /**
     * 请求购物车
     * @param request http请求
     * @return 获取购物车
     */
    @PostMapping("/books/{pageNum}")
    @ApiOperation("获取购物车")
    public ResultVo<List<CartEntity>> getShopCar(@PathVariable("pageNum") int pageNum,HttpServletRequest request) {
        return null;
    }

    /**
     * 删除购物车请求
     * @param id 编号
     * @return 是否成功
     */
    @PostMapping("/delete/{id}")
    @ApiOperation("删除订购商品")
    public ResultVo<String> deleteShopCar(@PathVariable("id") int id){
        return null;
    }

    @GetMapping("/total_price")
    @ApiOperation("获取订购商品总价格")
    public ResultVo<String> getTotalPrice(HttpServletRequest request){
        return null;
    }
}
